package com.bootdo.system.service;

import com.bootdo.common.utils.R;
import com.bootdo.system.domain.FileAuditDO;
import com.bootdo.system.domain.FileDO;
import com.bootdo.system.domain.ReportDo;
import com.bootdo.system.domain.UserFileDO;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

public interface UserFileService {

    /**
     * 获取文件列表信息
     * @param map
     * @return
     */
    List<UserFileDO> listFile(Map<String, Object> map);


    int countFile(Map<String, Object> map);

    /**
     * 创建文件夹
     * @param userFileDO
     * @return
     */
    R createDir(UserFileDO userFileDO);

    /**
     * 文件上传
     * @param file
     * @param userFileDO
     * @return
     */
    R uploadFile(MultipartFile[] file, UserFileDO userFileDO);

    /**
     * 文件同步到另一台服务器
     * @param rootPath
     * @param actualPath
     * @param file
     * @return
     */
    R synchroFile(String rootPath, String actualPath, MultipartFile file, String fileId, String uuid,String fileName, String fileType);

    /**
     * 文件发送
     * @param fileAuditDO
     * @return
     */
    R batchSend(FileAuditDO fileAuditDO);

    /**
     * 判断文件是否可以发送
     * @param ids
     * @return
     */
    R judeSend(Integer[] ids);

    /**
     * 获取我收到的文件列表信息
     * @param map
     * @return
     */
    List<UserFileDO> getMyReceiveFileList(Map<String, Object> map);

    int count(Map<String, Object> map);

    UserFileDO getDetail(int belong);

    /**
     * 删除文件及文件夹
     * @param ids
     * @return
     */
    R deleteFile(Integer[] ids);


    List<ReportDo> reportList(Map<String, Object> map);

    int reportCount(Map<String, Object> map);

    List<UserFileDO> getMyReceiveFileListFor(Map<String, Object> map);

    int countFor(Map<String, Object> map);

    List<ReportDo> tenReportList(Map<String, Object> map);

    int tenReportCount(Map<String, Object> map);

    ReportDo tenReportByTime(String addtime);

    List<ReportDo> typeList(Map<String, Object> map);

    int typeCount(Map<String, Object> map);

    /**
     * 关系递归
     * @param userFileDO
     * @return
     */
    List<UserFileDO> listFileFor(UserFileDO userFileDO);

    R uploadFileFor(FileDO fileDO, MultipartFile[] theFile, UserFileDO userFileDO) throws Exception;

    R cancelUploadFile(FileDO fileDO);

    R judeDeleteFile(Integer[] ids);

    List<UserFileDO> getFiletypeCount(Long auditid);

    @Async
    R uploadFileForAll(FileDO fileDO, MultipartFile file, UserFileDO userFileDO, String fileName2, String fileType2, String filePath2, String rootPath, String filePath, String actualPath1, String actualPath2);
}
